package org.nowcoder.huawei.c100;

import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 * 24: 寻找连续区间/数组连续和
 */
public class HC024 {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String[] vars = br.readLine().split(" ");
            int n = Integer.parseInt(vars[0]);
            int x = Integer.parseInt(vars[1]);

            vars = br.readLine().split(" ");
            int[] nums = new int[n];
            for (int i = 0; i < n; i++) {
                nums[i] = Integer.parseInt(vars[i]);
            }
            solve(nums, x);
        } catch (Exception e) {
            //throw new RuntimeException(e);
        }
    }

    public static void solve(int[] nums, int x) {
        int l = 0, r = 0;
        int sum = 0, count = 0;
        while (r < nums.length) {
            sum += nums[r];
            if (sum >= x) {
                sum = 0;
                count += (nums.length - r);
                r = ++l;
            } else {
                r++;
            }
        }
        System.out.println(count);
    }
}
